package org.openclinic.domain;

// Generated Nov 18, 2012 4:21:03 PM by Hibernate Tools 4.0.0

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Appointment generated by hbm2java
 */
@Entity
@Table(name = "appointment", schema = "public")
public class Appointment implements java.io.Serializable {

	private static final long serialVersionUID = -6734510807372777873L;
	
	private Long appointmentId;
	private Customer customer;
	private Attendant attendant;
	private MedicalSpecialty medicalSpecialty;
	private HealthProfessional healthProfessional;
	private boolean fit;
	private boolean canceled;
	private Date startDate;
	private Date endDate;
	private Date creationDate;
	private Date lastUpdate;

	public Appointment() {
	}

	public Appointment(long appointmentId) {
		this.appointmentId = appointmentId;
	}
	
	public Appointment(Long appointmentId, Customer customer, Attendant attendant, MedicalSpecialty medicalSpecialty,
			HealthProfessional healthProfessional, boolean fit, boolean canceled, Date startDate, Date endDate, 
			Date creationDate, Date lastUpdate) {
		this.appointmentId = appointmentId;
		this.customer = customer;
		this.medicalSpecialty = medicalSpecialty;
		this.healthProfessional = healthProfessional;
		this.attendant = attendant;
		this.fit = fit;
		this.canceled = canceled;
		this.startDate = startDate;
		this.endDate = endDate;
		this.creationDate = creationDate;
		this.lastUpdate = lastUpdate;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "appointment_id", unique = true, nullable = false)
	public Long getAppointmentId() {
		return this.appointmentId;
	}

	public void setAppointmentId(Long appointmentId) {
		this.appointmentId = appointmentId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "customer_id", nullable = false)
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "attendant_id", nullable = false)
	public Attendant getAttendant() {
		return this.attendant;
	}

	public void setAttendant(Attendant attendant) {
		this.attendant = attendant;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "specialty_id", nullable = false)
	public MedicalSpecialty getMedicalSpecialty() {
		return this.medicalSpecialty;
	}

	public void setMedicalSpecialty(MedicalSpecialty medicalSpecialty) {
		this.medicalSpecialty = medicalSpecialty;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "professional_id", nullable = false)
	public HealthProfessional getHealthProfessional() {
		return this.healthProfessional;
	}

	public void setHealthProfessional(HealthProfessional healthProfessional) {
		this.healthProfessional = healthProfessional;
	}

	@Column(name = "fit", nullable = false)
	public boolean isFit() {
		return this.fit;
	}

	public void setFit(boolean fit) {
		this.fit = fit;
	}

	@Column(name = "canceled", nullable = false)
	public boolean isCanceled() {
		return this.canceled;
	}

	public void setCanceled(boolean canceled) {
		this.canceled = canceled;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_date", nullable = false, length = 13)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_date", nullable = false, length = 13)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "creation_date", nullable = false, length = 13)
	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update", nullable = false, length = 13)
	public Date getLastUpdate() {
		return this.lastUpdate;
	}

	public void setLastUpdate(Date lastUpdate) {
		this.lastUpdate = lastUpdate;
	}

}
